home *** CD-ROM | disk | FTP | other *** search
- /*
- client per reserv
- */
-
-
- if host="" then do
- say "Usage: reclient"
- exit
- end
-
- sin.ADDRFAMILY = "INET"
- sin.ADDRPORT = 4000
- sin.ADDRADDR = inetaddr('127.0.0.1')
-
- sock=socket("INET","STREAM","IP")
- if sock<0 then do
- say "no socket:" Errno()
- exit
- end
-
- if connect(sock,"SIN") < 0 then do
- say "connect:" Errno()
- exit
- end
-
- REQUEST = "reverse service test"
- res = send(sock,REQUEST)
- if res ~= length(REQUEST) then do
- say "send:" Errno()
- exit
- end
-
- len = recv(sock,"BUF",256)
- if len<0 then do
- say "recv:" Errno()
- exit
- end
- say buf
- call closesocket(sock)
-